package com.wang.learn.cloudfeture.pojo;

import com.wang.learn.cloudfeture.demo.ConcurrentTest;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.concurrent.CountDownLatch;

/**
 * ClassName RunnableDemo
 *
 * @author wang
 * Date 2022/4/1 10:26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VolatileDemo implements Runnable {

    private CountDownLatch countDownLatch;


    @Override
    public void run() {
        try {
            countDownLatch.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        ConcurrentTest.num++;
        System.out.println(ConcurrentTest.num);

    }

}
